import Card from './Card'

class Player {
  name: string
  hand: Card[]

  constructor(name: string) {
    this.name = name
    this.hand = []
  }

  // 摸牌
  receiveCards(cards: Card[]) {
    this.hand.push(...cards)
  }

  // 出牌
  playCard(cardIndex: number) {
    return this.hand.splice(cardIndex, 1)[0]
  }
}

export default Player
